package cn.xiaohui;

public class Main {
	public static void main(String[] args) {
		Employer e;
        e=new BasicEmployee("张三","前台",5000.0);
		e.showSalary();
		e.showBonus();
		e=new GoodEmployee("李四","开发",6000,4000);
		e.showSalary();
		e.showBonus();	
	}
}
//abstract定义一个
abstract class Employer{
	String name;//姓名
	String department;//部门
	double salary;//工资
	double bons;//奖金
	
	abstract void showSalary();//抽象显示工资的方法
	abstract void showBonus();//抽象显示奖金方法
}
 class BasicEmployee extends Employer{
  public BasicEmployee(String name,String department,double salary) {
		this.name=name;
		this.department=department;
		this.salary=salary;
	}
	@Override
	void showSalary() {
		// TODO Auto-generated method stub
		System.out.println("我叫"+this.name+"在"+this.department+"部门,我的工资是"+this.salary+"元");
	}
	void showBonus() {
		System.out.println("我是普通员工,没有奖金，加油升级");
	}

}
class GoodEmployee extends Employer{
	public GoodEmployee(String name,String department,double salary,double bons) {
		this.name=name;
		this.department=department;
		this.salary=salary;
		this.bons=bons;
	}
	void showSalary() {
		System.out.println("我叫"+this.name+",在"+this.department+"部门，我的工资是"+salary);
	}
	void showBonus(){
	System.out.println("我是优秀员工，我的奖金是"+this.bons);
	}
}


